package cn.com.miao.lynx.plugin.storage.progress;

import cn.com.miao.lynx.plugin.storage.exception.StorageException;

/**
 * ObjectStorageProgress
 *
 * @title: ObjectStorageProgress
 * @description:
 * @author: dengmiao
 * @create: 2020-01-10 14:51
 **/
public interface ObjectStorageProgress {

    /**
     * progress
     * @param objectName          object name
     * @param percent             upload or download progress percent
     * @param totalBytes          total bytes
     * @param currentWrittenBytes already written bytes
     * @throws StorageException ApiBoot Oss Exception
     */
    void progress(String objectName, double percent, long totalBytes, long currentWrittenBytes) throws StorageException;

    /**
     * upload or download success
     * @param objectName object name
     * @throws StorageException ApiBoot Oss Exception
     */
    void success(String objectName) throws StorageException;

    /**
     * upload or download failed
     * @param objectName object name
     * @throws StorageException ApiBoot Oss Exception
     */
    void failed(String objectName) throws StorageException;
}
